<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>漫画首页</title>
    
    <!-- 引入 layui.css -->
    <link href="/static/layui/css/layui.css" rel="stylesheet">
    <!-- 引入 layui.js -->
    <script src="/static/layui/layui.js"></script>
    
    <script type="text/javascript">
        var json1=[];
        // 加载时自动读取json文件
        window.onload = function () {
            var url = "/static/man_hua/works/index.json"
            var request = new XMLHttpRequest();
            request.open("get", url);
            request.send(null);
            request.onload = function () {
                if (request.status == 200) {
                    json1 = JSON.parse(request.responseText);
                    create_work_index()
                }
            }
        }

        // 创建作品索引
        function create_work_index(){
            var index = document.getElementById("index");

            for(var i in json1){
                //创建标签
                var p = document.createElement("p");
                var a = document.createElement("a");
                a.href = "./show_works/"+json1[i];
                a.text=json1[i];
                p.appendChild(a);
                index.appendChild(p);
            };
        }

    </script>
</head>
<body>
    <!-- 添加去work网页按钮 -->
    <div>
        <p>
            <a href="./add_works">
                <button type="button" style="height:80px;width:200px;">添加作品</button>
            </a>
        </p>
    </div>
    <div id="index">
        <P>
            <a href="/man_hua/demo">demo</a>
        </P>
        <P>
            <a href="https://se8.us/">se8</a>
        </P>
        <P>
            <a href="https://www.aikanhanman.com">aikanhanman</a>
        </P>
        <P>
            <a href="https://www.mhua5.com">mhua5</a>
        </P>
        <P>
            <a href="https://aman5.org/">A漫</a>
        </P>
    </div>
</body>
</html>